package it.geosolutions.colorreduction;

import java.awt.RenderingHints;
import java.awt.image.RenderedImage;
import java.awt.image.renderable.ParameterBlock;

import javax.media.jai.CRIFImpl;

public class ColorReductionCRIF extends CRIFImpl {

	public RenderedImage create(ParameterBlock pb, RenderingHints hints) {
		final RenderedImage image = (RenderedImage) pb.getSource(0);
		final int numColors = pb.getIntParameter(0);
		final int alpaThreshold = pb.getIntParameter(1);
		final int subsx = pb.getIntParameter(2);
		final int subsy = pb.getIntParameter(3);
		return new ColorReduction(image, hints, numColors, alpaThreshold,
				subsx, subsy);
	}

}
